package com.recsmile.sgs.ui.components;

import com.recsmile.sgs.Constants;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

/**
 * Created by Administrator on 2016/8/25.
 */
public class ControlButtonGui extends JButton{
    private static final long serialVersionUID = -2494394522921888799L;

    private static final int WIDTH = Constants.SCREEN_WIDTH / 12;
    private static final int HEIGHT = Constants.SCREEN_HEIGHT / 12;
    public ControlButtonGui(String text, ActionListener listener)
    {
        super(text);
        setFont(new Font(Font.MONOSPACED, Font.BOLD, 15));
        setPreferredSize(new Dimension(WIDTH, HEIGHT));
        setHorizontalAlignment(JButton.CENTER);
        addActionListener(listener);
    }
}
